package collection;

import java.util.*;

/**
 *集合的排序：整数
 */
public class SortInteger {
    public static void main(String[] args) {
        Random a=new Random();
        List<Integer>list=new ArrayList<>();
        for(int i=0;i<10;i++){
          list.add(a.nextInt(1000));
        }
        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);

        Collections.reverse(list);
        System.out.println(list);
        System.out.println(list.get(0));




    }
}
